home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / DriverFamilyMatching.p < prev    next >
Text File  |  1996-05-01  |  10KB  |  298 lines

  1. {
  2.      File:        DriverFamilyMatching.p
  3.  
  4.      Contains:    xxx put contents here xxx
  5.  
  6.      Version:    Technology:    xxx put the technology version here xxx
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT DriverFamilyMatching;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DRIVERFAMILYMATCHING__}
  28. {$SETC __DRIVERFAMILYMATCHING__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DriverFamilyMatchingIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __NAMEREGISTRY__}
  38. {$I NameRegistry.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __TEXTOBJECTS__}
  41. {$I TextObjects.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __CODEFRAGMENTS__}
  44. {$I CodeFragments.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {  Please refer to Devices.i for DriverDescriptor definition for Marconi  }
  52. {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE }
  53. {
  54. #########################################################
  55.  Descriptor for Drivers and NDRVs
  56. #########################################################
  57. }
  58. {  Driver Typing Information Used to Match Drivers With Devices  }
  59.  
  60. TYPE
  61.     DriverTypePtr = ^DriverType;
  62.     DriverType = RECORD
  63.         nameInfoStr:            Str31;                                    {  Driver Name/Info String }
  64.         version:                NumVersion;                                {  Driver Version Number }
  65.     END;
  66.  
  67. {  OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment  }
  68.     RuntimeOptions                        = OptionBits;
  69.  
  70. CONST
  71.     kDriverIsLoadedUponDiscovery = $00000001;                    {  auto-load driver when discovered }
  72.     kDriverIsOpenedUponLoad        = $00000002;                    {  auto-open driver when loaded }
  73.     kDriverIsUnderExpertControl    = $00000004;                    {  I/O expert handles loads/opens }
  74.     kDriverIsConcurrent            = $00000008;                    {  supports concurrent requests }
  75.     kDriverQueuesIOPB            = $00000010;                    {  device manager doesn't queue IOPB }
  76.     kDriverIsLoadedAtBoot        = $00000020;                    {  Driver is loaded at the boot time  }
  77.     kDriverIsForVirtualDevice    = $00000040;                    {  Driver is for a virtual Device  }
  78.  
  79.  
  80. TYPE
  81.     DriverOSRuntimePtr = ^DriverOSRuntime;
  82.     DriverOSRuntime = RECORD
  83.         driverRuntime:            RuntimeOptions;                            {  Options for OS Runtime }
  84.         driverName:                Str31;                                    {  Driver's name to the OS }
  85.         driverDescReserved:        ARRAY [0..7] OF UInt32;                    {  Reserved area }
  86.     END;
  87.  
  88. {  OS Service Information Used To Declare What APIs a Driver Supports  }
  89.     ServiceCount                        = UInt32;
  90.     DriverServiceInfoPtr = ^DriverServiceInfo;
  91.     DriverServiceInfo = RECORD
  92.         serviceCategory:        OSType;                                    {  Service Category Name }
  93.         serviceType:            OSType;                                    {  Type within Category }
  94.         serviceVersion:            NumVersion;                                {  Version of service }
  95.     END;
  96.  
  97.     DriverOSServicePtr = ^DriverOSService;
  98.     DriverOSService = RECORD
  99.         nServices:                ServiceCount;                            {  Number of Services Supported }
  100.         service:                ARRAY [0..0] OF DriverServiceInfo;        {  The List of Services (at least one) }
  101.     END;
  102.  
  103. {  Categories  }
  104.  
  105. CONST
  106.     kServiceCategoryDisplay        = 'disp';                        {  Display Manager }
  107.     kServiceCategoryOpenTransport = 'otan';                        {  Open Transport }
  108.     kServiceCategoryBlockStorage = 'blok';                        {  Block Storage }
  109.     kServiceCategoryNdrvDriver    = 'ndrv';                        {  Generic Native Driver }
  110.     kServiceCategoryScsiSIM        = 'scsi';                        {  SCSI  }
  111.     kServiceCategoryFileManager    = 'file';                        {  File Manager  }
  112.     kServiceCategoryIDE            = 'ide-';                        {  ide  }
  113.     kServiceCategoryADB            = 'adb-';                        {  adb  }
  114.     kServiceCategoryPCI            = 'pci-';                        {  pci bus  }
  115.                                                                 {  Nu Bus  }
  116.     kServiceCategoryPCMCIA        = 'pcmc';                        {  PCMCIA  }
  117.     kServiceCategoryDFM            = 'dfm-';                        {  DFM  }
  118.     kServiceCategoryMotherBoard    = 'mrbd';                        {  mother Board  }
  119.     kServiceCategoryKeyboard    = 'kybd';                        {  Keyboard  }
  120.     kServiceCategoryPointing    = 'poit';                        {  Pointing  }
  121.     kServiceCategoryRTC            = 'rtc-';                        {  RTC  }
  122.     kServiceCategoryNVRAM        = 'nram';                        {  NVRAM  }
  123.     kServiceCategorySound        = 'sond';                        {  Sound (1/3/96 MCS)  }
  124.     kServiceCategoryPowerMgt    = 'pgmt';                        {  Power Management  }
  125.     kServiceCategoryGeneric        = 'genr';                        {  Generic Service Category to receive general Events  }
  126.  
  127. {  Ndrv ServiceCategory Types  }
  128.     kNdrvTypeIsGeneric            = 'genr';                        {  generic }
  129.     kNdrvTypeIsVideo            = 'vido';                        {  video }
  130.     kNdrvTypeIsBlockStorage        = 'blok';                        {  block storage }
  131.     kNdrvTypeIsNetworking        = 'netw';                        {  networking }
  132.     kNdrvTypeIsSerial            = 'serl';                        {  serial }
  133.     kNdrvTypeIsSound            = 'sond';                        {  sound }
  134.     kNdrvTypeIsBusBridge        = 'brdg';
  135.  
  136.  
  137. TYPE
  138.     DriverDescVersion                    = UInt32;
  139. {     The Driver Description  }
  140.  
  141. CONST
  142.     kInitialDriverDescriptor    = 0;
  143.     kVersionOneDriverDescriptor    = 1;
  144.  
  145.     kTheDescriptionSignature    = 'mtej';
  146.     kDriverDescriptionSignature    = 'pdes';
  147.  
  148.  
  149. TYPE
  150.     DriverDescriptionPtr = ^DriverDescription;
  151.     DriverDescription = RECORD
  152.         driverDescSignature:    OSType;                                    {  Signature field of this structure }
  153.         driverDescVersion:        DriverDescVersion;                        {  Version of this data structure }
  154.         driverType:                DriverType;                                {  Type of Driver }
  155.         driverOSRuntimeInfo:    DriverOSRuntime;                        {  OS Runtime Requirements of Driver }
  156.         driverServices:            DriverOSService;                        {  Apple Service API Membership }
  157.     END;
  158.  
  159. {$ENDC}
  160. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  161. {
  162. ################################################
  163.  Family Matching Data Structure
  164. ################################################
  165. }
  166. {     The Family Type  }
  167.  
  168. CONST
  169.     kFamilyIsHighLevel            = 0;                            {  High Level Family  }
  170.     kFamilyIsLowLevel            = 1;                            {  Low Level Family   }
  171.  
  172.  
  173. TYPE
  174.     FamilyLevel                            = UInt32;
  175. {  Family Typing Information Used to Match Families With plug-ins and Devices  }
  176.     FamilyTypePtr = ^FamilyType;
  177.     FamilyType = RECORD
  178.         familyLevel:            FamilyLevel;                            {  Kind of Family  }
  179.         familyName:                OSType;                                    {  Family Name  }
  180.         version:                NumVersion;                                {  Family Version Number }
  181.         reserved:                OSType;                                    {  Used by Mother Board Expert  }
  182.     END;
  183.  
  184.  
  185. CONST
  186.     kFamilyIsLoadedAtBoot        = $00000001;                    {  Family is loaded at the boot time  }
  187.     kFamilyIsLoadedUponDiscovery = $00000002;                    {  auto-load Family when discovered  }
  188.     kFamilyIsStartedAtBoot        = $00000004;                    {  Family is initialized at the Boot  }
  189.  
  190.  
  191. TYPE
  192.     FamilyOSRunTimeOptions                = UInt32;
  193.     FamilyOSRunTimePtr = ^FamilyOSRunTime;
  194.     FamilyOSRunTime = RECORD
  195.         familyRuntime:            FamilyOSRunTimeOptions;                    {  Options for OS Runtime }
  196.         familyName:                Str31;                                    {  Family's name to the OS }
  197.         familyDescReserved:        ARRAY [0..7] OF UInt32;                    {  Reserved area }
  198.     END;
  199.  
  200. {     The Family Description  }
  201.  
  202. CONST
  203.     kFamilyDescriptionSignature    = 'fdes';
  204.  
  205.  
  206. TYPE
  207.     FamilyDescVersion                    = UInt32;
  208.  
  209. CONST
  210.     kInitialFamilyDescriptor    = 0;
  211.     kMotherBoardDescriptor        = 1;
  212.  
  213.  
  214. TYPE
  215.     DependencyCount                        = UInt32;
  216.     MatchingAndDependencyInfoPtr = ^MatchingAndDependencyInfo;
  217.     MatchingAndDependencyInfo = RECORD
  218.         CASE INTEGER OF
  219.         0: (
  220.             deviceName:            Str31;                                    {  the device name to match  }
  221.             );
  222.         1: (
  223.             dependency:            OSType;                                    {  Dependency List  }
  224.             );
  225.     END;
  226.  
  227.     FamilyMatchingAndDependencyPtr = ^FamilyMatchingAndDependency;
  228.     FamilyMatchingAndDependency = RECORD
  229.         nrElements:                DependencyCount;                        {  Number of elements in the Array  }
  230.         matchingInfo:            ARRAY [0..0] OF MatchingAndDependencyInfo;
  231.     END;
  232.  
  233.     FamilyDescriptionPtr = ^FamilyDescription;
  234.     FamilyDescription = RECORD
  235.         familyDescSignature:    OSType;                                    {  Signature field of this structure }
  236.         familyDescVersion:        FamilyDescVersion;                        {  Version of this data structure }
  237.         familyType:                FamilyType;                                {  Type of Driver }
  238.         familyOSRuntime:        FamilyOSRunTime;                        {  OS Runtime Requirements of Family  }
  239.         familymatchingAndDependency: FamilyMatchingAndDependency;        {  Family Dependency Info  }
  240.     END;
  241.  
  242. {
  243. ##############################################
  244.  Definition of "driver-ptr" property
  245. ##############################################
  246. }
  247.     DriverPtrPropertyPtr = ^DriverPtrProperty;
  248.     DriverPtrProperty = RECORD
  249.         pluginLocator:            LogicalAddress;
  250.         length:                    UInt32;
  251.     END;
  252.  
  253. {
  254. ##############################################
  255.  Status Definition for DFMReportInitStatus
  256. ##############################################
  257. }
  258.  
  259. CONST
  260.     kInitStatusOK                = 0;
  261.     kInitStatusNotOK            = 1;
  262.  
  263. {
  264. ##############################################
  265.  Declare the pluginLoadID
  266. ##############################################
  267. }
  268.  
  269. TYPE
  270.     PluginLoadID = ^LONGINT;
  271. {
  272. ##############################################
  273.  Function Prototypes
  274. ##############################################
  275. }
  276. FUNCTION DFMReportInitStatus(serviceCategory: OSType; status: UInt32): UInt32; C;
  277. FUNCTION DFMRemovePlugIns(VAR device: RegEntryRef; serviceCategory: OSType; nrPlugIns: UInt32; VAR pluginLocatorsInUse: LogicalAddress): OSStatus; C;
  278. FUNCTION DFMLoadPlugin(pluginLocator: LogicalAddress; pluginName: Str63; VAR pluginLoadID: PluginLoadID; VAR main: LogicalAddress; VAR pluginDT: LogicalAddress; optErrMsg: TextObject): OSStatus; C;
  279. FUNCTION DFMUnloadPlugin(VAR pluginLoadID: PluginLoadID): OSStatus; C;
  280. FUNCTION DFMGetCFragConnectID(VAR pluginLoadID: PluginLoadID; VAR connectionID: CFragConnectionID): OSStatus; C;
  281. {
  282. ##############################################
  283.  Well known properties in the Name Registry
  284. ##############################################
  285. }
  286. {  CPassThru  }
  287. {$ENDC}
  288. {$ALIGN RESET}
  289. {$POP}
  290.  
  291. {$SETC UsingIncludes := DriverFamilyMatchingIncludes}
  292.  
  293. {$ENDC} {__DRIVERFAMILYMATCHING__}
  294.  
  295. {$IFC NOT UsingIncludes}
  296.  END.
  297. {$ENDC}
  298.